﻿@using Microsoft.AspNetCore.Http.Extensions
@using NewLife.Common;
@{
    var cfg = NewLife.Common.SysConfig.Current;
    var user = ManageProvider.User;
    var retUrl = Context.Request.GetEncodedPathAndQuery();
}
<div class="navbar navbar-default">
    <div class="container">
        <div class="navbar-header">
            <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-responsive-collapse">
                <span class="sr-only"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="~/">@cfg.DisplayName<sub>@cfg.Name</sub></a>
        </div>
        <div class="navbar-collapse collapse navbar-responsive-collapse">
            <ul class="nav navbar-nav">
                <li>@Html.ActionLink("首页", "Index", "Home")</li>
                <li>@Html.ActionLink("关于我们", "About", "Home")</li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                @if (user == null)
                {
                    <li class="">@Html.ActionLink("注册", "Register", "Account")</li>
                    <li class="">@Html.ActionLink("登录", "Login", "Account", new { r = retUrl }, null)</li>
                }
                else
                {
                    <li class="">@Html.ActionLink(user + "", "Detail", "Account", new { user.ID }, null)</li>
                    <li class="">@Html.ActionLink("注销", "Logout", "Account", new { r = retUrl }, null)</li>
                }
            </ul>
        </div>
    </div>
</div>
